package com.gc.ip;

import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;


public class JIPAddressCellRenderer implements TableCellRenderer
{
	private JIPAddress jIPAddressComp = null;
	
	public JIPAddressCellRenderer(JIPAddress ipAddress)
	{
		this.jIPAddressComp = ipAddress;
	}
	public JIPAddressCellRenderer()
	{
		this(new JIPAddress());
	}
	
	@Override
	public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
		boolean hasFocus, int row, int column)
	{
		IPAddress ip = null;
		if(value instanceof IPAddress)
			ip = (IPAddress) value;

		jIPAddressComp.setIPAddress(ip);

		return jIPAddressComp;
	}

}
